package com.hxkj.domain.enums;

import com.platform.common.domain.exception.CustomExceptionCode;

/**
 * 排行榜异常枚举
 * <p>
 * Created by yaosy on 2018年6月13日21:01:45
 */
public enum RankingManagementExceptionEnum implements CustomExceptionCode {

    COMPANY_INFO_EXCEPTION_NOT_ID(600, "排行榜管理id为空", 900),
    //COMPANY_INFO_EXCEPTION_NOT_ID(601, "排行榜管理id为空", 900),



    ;
    private Integer code;
    private String msg;
    private Integer httpCode;

    RankingManagementExceptionEnum(Integer code, String msg, Integer httpCode) {
        this.code = code;
        this.msg = msg;
        this.httpCode = httpCode;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public Integer getHttpCode() {
        return httpCode;
    }

    @Override
    public void setHttpCode(Integer httpCode) {
        this.httpCode = httpCode;
    }


    public static RankingManagementExceptionEnum getEnumByCode(Integer code){
        for(RankingManagementExceptionEnum siteExceptionEnum : RankingManagementExceptionEnum.values()){
            if(code.equals(siteExceptionEnum.getCode())){
                return siteExceptionEnum;
            }
        }
        return null;
    }
}
